﻿@model Webcar.Entitys.BS_CAR_RECORD
@using (Ajax.BeginForm("EditSave", "Car",
    new AjaxOptions
    {
        HttpMethod = "POST",
        //OnBegin = "function(){ loadingPanel.Show(); }",
        //OnComplete = "function(){ loadingPanel.Hide(); }",
        UpdateTargetId = "error-content",
        InsertionMode = InsertionMode.Replace
    }))
{
    @Html.AntiForgeryToken()
    <div id="edit-car">
        @Html.HiddenFor(a => a.CAR_NO)
        @Html.HiddenFor(a => a.IS_USE)

        <table class="edit-table">
            <tr>
                <td style="width: 80px; text-align: right">*牌照号：</td>
                <td style="width: 200px">@Html.TextBoxFor(a => a.RECORD_NO, new { @style = "width: 100%;", @onkeyup = "this.value=this.value.toUpperCase();" })</td>
                <td style="width: 80px; text-align: right">内部牌照号：</td>
                <td style="width: 200px">@Html.TextBoxFor(a => a.CAR_RECORD2, new { @style = "width: 100%;", @onkeyup = "this.value=this.value.toUpperCase();" })</td>
            </tr>
            <tr>
                <td style="width: 80px; text-align: right;">*所属单位：</td>
                
                 @if (Model.CAR_NO == null)
                { 
                    <td>@Html.DropDownListFor(a => a.DEPT_CODE, WebcarDataHelper.UserSuperDeptList, new { @style = "width: 100%;", @onchange = "retriveChildDept();" })</td>
                }
                else
                {
                    <td>@ViewBag.DeptName
                        @Html.HiddenFor(a => a.DEPT_CODE)
                        </td>
                }
                
                
                <td style="width: 80px; text-align: right">下级单位：</td>
                <td>@Html.DropDownListFor(a => a.CHILD_DEPT, WebcarDataHelper.GetChildDeptByDeptList(Model.DEPT_CODE), new { @style = "width: 100%;" })</td>
            </tr>
            <tr>
                <td style="width: 80px; text-align: right;">*行驶证单位：</td>
                <td colspan="3">@Html.TextBoxFor(a => a.RUN_DEPT, new { @style = "width: 100%;" })</td>
            </tr>
            <tr>
                <td style="width: 80px; text-align: right;">*车辆用途：</td>
                <td>@Html.DropDownListFor(a => a.CAR_USE, WebcarDataHelper.CarUseDropDown, new { @style = "width: 100%;" })</td>
                <td style="width: 80px; text-align: right">*排气量：</td>
                <td>@Html.TextBoxFor(a => a.displacemint, new { @style = "width: 100%;" })</td>
            </tr>
            <tr>
                <td style="width: 80px; text-align: right;">*车型：</td>
                <td>@Html.DropDownListFor(a => a.CAR_SORT, WebcarDataHelper.CarSortDropDown, new { @style = "width: 100%;" })</td>
                <td style="width: 80px; text-align: right">*详细车型：</td>
                <td>@Html.TextBoxFor(a => a.car_class_name, new { @style = "width: 100%;", @onkeyup = "this.value=this.value.toUpperCase();" })</td>
            </tr>
            <tr>
                <td style="width: 80px; text-align: right;">*载客(人)：</td>
                <td>@Html.TextBoxFor(a => a.GUEST_NUM, new { @style = "width: 100%;" })</td>
                <td style="width: 80px; text-align: right">资产归属：</td>
                <td>@Html.DropDownListFor(a => a.ASSET_DEPT, new SelectList(WebcarDataHelper.AssertKind, "Item1", "Item2"), new { @style = "width: 100%;" })</td>
            </tr>

            <tr>
                <td style="width: 80px; text-align: right;">*引擎号：</td>
                <td>@Html.TextBoxFor(a => a.ENGINE_NO, new { @style = "width: 100%;" })</td>
                <td style="width: 80px; text-align: right">车架号：</td>
                <td>@Html.TextBoxFor(a => a.SHELF_NO, new { @style = "width: 100%;" })</td>

            </tr>

            <tr>
                <td style="width: 80px; text-align: right;">*购置日期：</td>
                <td>@Html.CalendarFor(a => a.BUY_DATE)</td>
                <td style="width: 80px; text-align: right">购置号：</td>
                <td>@Html.TextBoxFor(a => a.BUY_NO, new { @style = "width: 100%;" })</td>

            </tr>
            <tr>
                <td style="width: 80px; text-align: right;">*价格(万)：</td>
                <td>@Html.TextBoxFor(a => a.VALUE, new { @style = "width: 100%;" })</td>
                <td style="width: 80px; text-align: right">*载重(吨)：</td>
                <td>@Html.TextBoxFor(a => a.CARRY_WEIGHT, new { @style = "width: 100%;" })</td>

            </tr>
            <tr>
                <td style="width: 80px; text-align: right;">*颜色：</td>
                <td>@Html.TextBoxFor(a => a.COLOR, new { @style = "width: 100%;" })</td>
                <td style="width: 80px; text-align: right">*百公里油耗：</td>
                <td>@Html.TextBoxFor(a => a.FUEL_100MILE, new { @style = "width: 100%;" })</td>
            </tr>
            <tr>
                <td style="width: 80px; text-align: right">特种车辆：</td>
                <td>@Html.CheckBoxFor(a => a.IsTz, new { @style = "width: 100%;" })</td>
                <td style="width: 80px; text-align: right">车辆状态：</td>
                <td>
                    @if (Model.IS_USE == "D")
                        {<span  style="color:red">正常</span>}
                    else if (Model.IS_USE == "F")
                        {<span  style="color:red">作废</span>}
                    else 
                        {<span style="color:red">正常</span>}
                </td>
            </tr>
        </table>


        <br />
        @Html.ErrorLabel("error-content")

    </div>
    <div class="edit-button">
        @Html.DevExpress().Button(settings =>
        {
            settings.Name = "Button1";
            settings.Text = CurrentUser.CheckPermission(PermissionManager.编辑车辆档案)?"保存":"无权限";
            settings.Enabled = CurrentUser.CheckPermission(PermissionManager.编辑车辆档案);
            settings.UseSubmitBehavior = true;
            settings.Width = 70;
            settings.ControlStyle.CssClass = "button1";
            
        }).GetHtml()
        @Html.DevExpress().Button(settings =>
        {
            settings.ControlStyle.CssClass = "button2";
            settings.Name = "Button2";
            settings.Text = "取消";
            settings.Width = 70;
            settings.ClientSideEvents.Click = "function(s, e){ pcModalMode.Hide(); }";

        }).GetHtml()
    </div>
}



